﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace S.RBAC.Infrastructure.Migrations
{
    public partial class Upd0509_3 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Department",
                columns: table => new
                {
                    DepartId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PId = table.Column<int>(type: "int", nullable: false),
                    DepartCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    DepartName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DepartState = table.Column<bool>(type: "bit", nullable: false),
                    DepartTypeId = table.Column<int>(type: "int", nullable: false),
                    DepartRank = table.Column<int>(type: "int", nullable: false),
                    DepartLocation = table.Column<string>(type: "nvarchar(300)", maxLength: 300, nullable: true),
                    Principal = table.Column<int>(type: "int", nullable: false),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Department", x => x.DepartId);
                });

            migrationBuilder.CreateTable(
                name: "DepartType",
                columns: table => new
                {
                    DepartTypeId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DepartTypeName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DepartType", x => x.DepartTypeId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Department");

            migrationBuilder.DropTable(
                name: "DepartType");
        }
    }
}
